(function(){
	var zongji=$("#zongji"),
		trs=$("table tbody tr");
	zongji.text(trs.length);
	/*上下架**/
	var xiajia =$(".xiajia"),
		shangjia =$(".shangjia"),
		shanchu2=$("#shanchu2"),
		chacha=$("#chacha"),
		o5_ok=$("#o5_ok"),
		o5_dele=$("#o5_dele"),
		o5_no=$("#o5_no"),
		querenshanchu=$("#querenshanchu"),
		shanchu1=$("#shanchu1"),
		shanchuchenggong=$("#shanchuchenggong");
	xiajia.on("click",function(){
		var that =this;
		shanchu1.css("display","block");
		querenshanchu.text("确定要删除该作品，删除后将不可恢复。");
		o5_dele.on("click",function(){
			shanchu1.css("display","none");
		})
		o5_ok.on("click",function(){
			shanchu1.css("display","none");
			shanchu2.css("display","block");
			shanchuchenggong.text("下架成功");
		})
		o5_no.on("click",function(){
			shanchu1.css("display","none");
		})
	})
	chacha.on("click",function(){
		shanchu2.css("display","none");
	})
	shangjia.on("click",function(){
		var that =this;
		shanchu1.css("display","block");
		querenshanchu.text("您确定要上架该商品吗？");
		
		o5_dele.on("click",function(){
			shanchu1.css("display","none");
		})
		o5_ok.on("click",function(){
			shanchu1.css("display","none");
			shanchu2.css("display","block");
			shanchuchenggong.text("上架成功");
		})
		o5_no.on("click",function(){
			shanchu1.css("display","none");
		})
	})

    $(".jiantou").each(function () {
        $(this).on("mouseenter",function () {
            $(this).parent().find(".dialog").css({
                "display":"block",
                "z-index":"99",
                "left":"-19px",
                "bottom":"60px",
                "text-align":"center"
            })
            $(this).css("background","#efefef");
        })
        $(this).on("mouseleave",function () {
            $(this).parent().find(".dialog").css({
                "display":"none",
                "z-index":"99",
                "left":"-19px",
                "bottom":"60px",
                "text-align":"center"
            })
            $(this).css("background","none");
        })
    })



})();
